package com.lansi.bean;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

public class Key  implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 152904035171929289L;
	private Integer id;
	private String usermail;
	private String regcode;
	private Date ctime;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsermail() {
		return usermail;
	}
	public void setUsermail(String usermail) {
		this.usermail = usermail;
	}
	public String getRegcode() {
		return regcode;
	}
	public void setRegcode(String regcode) {
		this.regcode = regcode;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	public Date getCtime() {
		return ctime;
	}
	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}
	@Override
	public String toString() {
		return "Key [id=" + id + ", usermail=" + usermail + ", regcode=" + regcode + ", ctime=" + ctime + "]";
	}
	public Key() {
		
	}
	
	public Key(Integer id, String usermail, String regcode, Date ctime) {
		super();
		this.id = id;
		this.usermail = usermail;
		this.regcode = regcode;
		this.ctime = ctime;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ctime == null) ? 0 : ctime.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((regcode == null) ? 0 : regcode.hashCode());
		result = prime * result + ((usermail == null) ? 0 : usermail.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Key other = (Key) obj;
		if (ctime == null) {
			if (other.ctime != null)
				return false;
		} else if (!ctime.equals(other.ctime))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (regcode == null) {
			if (other.regcode != null)
				return false;
		} else if (!regcode.equals(other.regcode))
			return false;
		if (usermail == null) {
			if (other.usermail != null)
				return false;
		} else if (!usermail.equals(other.usermail))
			return false;
		return true;
	}
	
	
}
